home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / misc.736 < prev    next >
Text File  |  1992-02-06  |  3KB  |  71 lines

  1. {\rtf0\ansi{\fonttbl\f1\fnil Times-Roman;\f0\fmodern Courier;\f2\fswiss Helvetica;}
  2. \paperw11640
  3. \paperh8020
  4. \margl120
  5. \margr120
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f1\b0\i0\ul0\fs28 make removes files\
  8. \
  9.  
  10. \fi-420\li440 Q:  
  11. \fc0 Every now and then, if I use control-c to interrupt a 
  12. \f0\b\fs24 make(1
  13. \b0 )
  14. \f1\fs28 , it decides to remove one of  my files.  I admit that my code isn't always the cleanest, but is my computer trying to tell me something?  Is there a cure for this? \
  15.  
  16. \fi0\li0 \
  17.  
  18. \fi-440\li440 A:  There is a bug in 
  19. \f0\b\fs24 make
  20. \f1\b0\fs28  where it sometimes removes a source file instead of the target when interrupted.  Here is a script of one of those nasty interchanges between you and 
  21. \f0\b\fs24 make
  22. \f1\b0\fs28 :\
  23. \
  24.  
  25. \f0\fs24\fi-20\li1420 hostname> make debug\
  26. ^C*** `File.m' removed\
  27. *** Exit 2\
  28. Stop.\
  29. \
  30. hostname> make debug\
  31. Make:  Don't know how to make File.m.  Stop.\
  32. *** Exit 1\
  33. Stop.\
  34.  
  35. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f2\fc0 \
  36.  
  37. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f1\fs28\li440 As a workaround, you can add the .PRECIOUS pseudo-target in your 
  38. \b Makefile.postamble
  39. \b0  to protect yourself from this unwanted deletion.  (See below for more about .PRECIOUS)  It should depend on SRCFILES (which covers CFILES, MFILES, HFILES, nibs, tiffs, etc).\
  40.  
  41. \pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\fs24\li1360\fc0 #\
  42. #  Make sure we don't remove anything by accident if \
  43. #  interrupted at the wrong time.\
  44. #\
  45. .PRECIOUS : $(SRCFILES)\
  46.  
  47. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f2\fc0 \
  48.  
  49. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b\li440 \
  50.  
  51. \f1\b0\fs28 \
  52. About .PRECIOUS\
  53.  
  54. \f0\b\fs24 \
  55. make
  56. \f1\b0\fs28  normally stops if any command it generates returns a non-zero exit code.  Before quitting, however, it removes the current target it is making.  The assumption here is that target is probably in a partly finished state.  If it were left in place, it would show as up-to-date in subsequent invocations of make, due to its now-revised date of last modification.  \
  57. \
  58. There may be occasions when you do not want the target removed upon occurrence of errors.  The .PRECIOUS: pseudo-target allows you to specify any file you do not want destroyed.  For example., the description fie entry\
  59.  
  60. \f0\fs24     .PRECIOUS : target1 target2 target3\
  61.  
  62. \f1\fs28 prevents any of the three named targets from being removed by make.  This entry can occur anywhere in the description file.\
  63.  
  64. \li0\fc0 \
  65. QA736\
  66. \
  67. Valid for 1.0\
  68. Valid for 2.0\
  69. \
  70.  
  71.